import 'package:flutter/material.dart';
import './data_list.dart';
import '../../../widgets/search_bar/index.dart';
import '../../../widgets/room_list_item_widget.dart';
import './filter_bar/index.dart';
import './filter_bar/filter_drawer.dart';

class TabSearch extends StatefulWidget {
  const TabSearch({Key key}) : super(key: key);

  @override
  _TabSearchState createState() => _TabSearchState();
}

class _TabSearchState extends State<TabSearch> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      endDrawer: FilterDrawer(),
      appBar: AppBar(
        elevation: 0,
        title: SearchBar(
          defaultInputValue: '请输入搜索词',
          shwoLocation: true,
          onSearch: () {
            Navigator.of(context).pushNamed('search');
          },
        ),
        actions: [
          Container()
        ],
        backgroundColor: Colors.white,
      ),
      body: Column(
        children: [
          Container(
            height: 41.0,
            child: FilterBar(
              onChange: (context) {

              },
            ),
          ),
          Expanded(
            child: ListView(
              children: dataList
                  .map((item) => RoomListItemWidget(data: item))
                  .toList(),
            ),
          )
        ],
      ),
    );
  }
}
